package com.bdqn.entity;

import java.io.Serializable;
import java.util.Date;

import org.apache.commons.lang3.StringUtils;

public class Food implements Serializable {
    private Integer id;

    private String name;

    private Double price;

    private Integer num;

    private Double freight;

    private String images;

    private Integer salnum;

    private Integer integral;

    private String hasintegral;

    private Integer status;

    private Date createtime;

    private Date updatetime;

    private static final long serialVersionUID = 1L;

    private  String  cover;//封面
    
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public Double getFreight() {
        return freight;
    }

    public void setFreight(Double freight) {
        this.freight = freight;
    }

    public String getImages() {
        return images;
    }

    public void setImages(String images) {
        this.images = images == null ? null : images.trim();
    }

    public Integer getSalnum() {
        return salnum;
    }

    public void setSalnum(Integer salnum) {
        this.salnum = salnum;
    }

    public Integer getIntegral() {
        return integral;
    }

    public void setIntegral(Integer integral) {
        this.integral = integral;
    }

    public String getHasintegral() {
        return hasintegral;
    }

    public void setHasintegral(String hasintegral) {
        this.hasintegral = hasintegral == null ? null : hasintegral.trim();
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public Date getUpdatetime() {
        return updatetime;
    }

    public void setUpdatetime(Date updatetime) {
        this.updatetime = updatetime;
    }

	public String getCover() {
		if(StringUtils.isNotBlank(images)){
			return  images.split(",")[0];
		}
		return cover;
	}

	public void setCover(String cover) {
		this.cover = cover;
	}
    
    
}